﻿using System;

namespace DbMetadata.Providers
{
    /// <summary>
    /// Represents a type mapper that maps the column types retrieved from the database to native CLR data types.
    /// </summary>    
    public interface ITypeMapper
    {
        /// <summary>
        /// Maps an external type description to a CLR type. 
        /// </summary>
        /// <param name="dataType">The data type as described by the database metadata.</param>
        /// <param name="isNullable">True is the data type should be treated as nullable, otherwise False.</param>
        /// <returns></returns>
        /// <remarks>
        /// If the datatype represented in the database metadata is nullable, this method should return a nullable CLR type.
        /// </remarks>
        Type MapType(string dataType, bool isNullable);
    }
}
